package com.maserb.monitor.dataCenter.communication;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

public class ReceiveConverter {
    public static int convertInt(byte[] data) {
        int result = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN).getInt();
        return result;
    }

    public static byte[] convertByteArray(byte[] data) {
        byte[] result = new byte[data.length];
        ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN).get(result);
        return result;
    }
}
